# -*- coding:utf-8 -*-
"""EduOnline URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/1.11/topics/http/urls/
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  url(r'^$', views.home, name='home')
Class-based views
    1. Add an import:  from other_app.views import Home
    2. Add a URL to urlpatterns:  url(r'^$', Home.as_view(), name='home')
Including another URLconf
    1. Import the include() function: from django.conf.urls import url, include
    2. Add a URL to urlpatterns:  url(r'^blog/', include('blog.urls'))
"""
from django.conf.urls import url, include
# from django.contrib import admin
import xadmin
from django.views.generic import TemplateView

from users.views import RegisterView, ActiveUserView
from users.views import ForgetPwdView, ResetPwdView, ModifyPwdView
from users.views import LoginView, LogoutView

# `/(?P<param>.*)/$`
# --表：将`.*`所代表的数据赋值给`param`，即将参数传给视图函数（ `param`为被视图函数的参数）
# --该url为其它视图所生成，之后再进入该url，之后再提取运用
urlpatterns = [
    # url(r'^admin/', admin.site.urls),
    url(r'^xadmin/', xadmin.site.urls),
    url(r'^index/$', TemplateView.as_view(template_name='index.html'), name='index'),
    url(r'^register/$', RegisterView.as_view(), name='register'),
    url(r'^activeuser/(?P<active_code>.*)/$', ActiveUserView.as_view(), name='activeuser'),
	url(r'^captcha/', include('captcha.urls')),
	url(r'^forgetpwd/', ForgetPwdView.as_view(), name='forgetpwd'),
	url(r'^resetpwd/(?P<reset_code>.*)/$', ResetPwdView.as_view(), name='resetpwd'),
    url(r'^modifypwd/$', ModifyPwdView.as_view(), name='modifypwd'),
    url(r'^login/$', LoginView.as_view(), name='login'),
    url(r'^logout/$', LogoutView.as_view(), name='logout'),
    url(r'^forgetpwd/$', LogoutView.as_view(), name='forgetpwd'),
]
